﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FastReportPractice.Utilities
{
    public class DBProvider
    {
        public const string DefaultConnectionString = "Data Source=192.168.88.127;AttachDbFilename=;Initial Catalog=JQ.Pacs.1.0;Integrated Security=False;Persist Security Info=True;User ID=sa;Password=123456";

        private static SqlSugarClient _defaultDbContext;


        /// <summary>
        /// PACS数据库上下文
        /// </summary>
        public static SqlSugarClient DefaultDBContext
        {
            get
            {
                _defaultDbContext = new SqlSugarClient(new ConnectionConfig
                {
                    ConnectionString = DefaultConnectionString,
                    DbType = DbType.SqlServer,
                    IsAutoCloseConnection = true,
                    InitKeyType = InitKeyType.SystemTable
                });
                return _defaultDbContext;
            }
        }
    }
}
